package com.ruoyi.service.impl;

import java.util.List;

import com.ruoyi.system.api.domain.SysTCwAppli;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.TCwAppliMapper;
import com.ruoyi.domain.TCwAppli;
import com.ruoyi.service.ITCwAppliService;

/**
 * 支付宝跑批Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-03-14
 */
@Service
public class TCwAppliServiceImpl implements ITCwAppliService 
{
    @Autowired
    private TCwAppliMapper tCwAppliMapper;

    /**
     * 查询支付宝跑批
     * 
     * @param id 支付宝跑批主键
     * @return 支付宝跑批
     */
    @Override
    public TCwAppli selectTCwAppliById(Long id)
    {
        return tCwAppliMapper.selectTCwAppliById(id);
    }

    /**
     * 查询支付宝跑批列表
     * 
     * @param tCwAppli 支付宝跑批
     * @return 支付宝跑批
     */
    @Override
    public List<TCwAppli> selectTCwAppliList(TCwAppli tCwAppli)
    {
        return tCwAppliMapper.selectTCwAppliList(tCwAppli);
    }
    /**
     * 新增支付宝跑批列表
     *
     * @param tCwAppli 支付宝跑批
     * @return 支付宝跑批
     */
    @Override
    public int insertTCwAppli(TCwAppli tCwAppli)
    {
        List<TCwAppli> tCwApplis = selectTCwAppliList(tCwAppli);
        int i=0;
        for (TCwAppli cwAppli : tCwApplis) {
            if(cwAppli!=null){
                i =  tCwAppliMapper.updateTCwAppli(cwAppli);
            }else{
                i =  tCwAppliMapper.insertTCwAppli(tCwAppli);
            }
        }

        return i;
    }


    @Override
    public int updateTCwAppli(TCwAppli tCwAppli) {
       return tCwAppliMapper.updateTCwAppli(tCwAppli);
    }
     /* @Override
    public int updateTCwAppli(TCwAppli tCwAppli)
    {
        return tCwAppliMapper.updateTCwAppli(tCwAppli);
    }*/

    /**
     * 新增支付宝跑批
     * 
     * @param tCwAppli 支付宝跑批
     * @return 结果
     */


    /**
     * 修改支付宝跑批
     * 
     * @param tCwAppli 支付宝跑批
     * @return 结果
     */


    /**
     * 批量删除支付宝跑批
     * 
     * @param ids 需要删除的支付宝跑批主键
     * @return 结果
     */
    @Override
    public int deleteTCwAppliByIds(Long[] ids)
    {
        return tCwAppliMapper.deleteTCwAppliByIds(ids);
    }

    /**
     * 删除支付宝跑批信息
     * 
     * @param id 支付宝跑批主键
     * @return 结果
     */
    @Override
    public int deleteTCwAppliById(Long id)
    {
        return tCwAppliMapper.deleteTCwAppliById(id);
    }
}
